import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { createPinia } from 'pinia'
import piniaPluginPersistedState from 'pinia-plugin-persistedstate'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import './style.css'        //提示：自定义的全局样式必须放在ElementPlus样式之后

let app = createApp(App)
/*
app.config.errorHandler = (err)=>{      //给Vue应用配置全局的错误处理函数
    alert('页面执行过程中发生错误！请联系管理员！')
    // alert(err)
}
*/
let pinia = createPinia()   //创建pinia插件对象，注册给当前应用
pinia.use(piniaPluginPersistedState)
app.use(pinia)

app.use(router)       //在整个应用中使用一个插件：路由器插件
app.use(ElementPlus)
//app.component('RouterView', {})
app.mount('#app')
